<?php TPL::output('admin/admin_header.tpl.htm'); ?>

<body >

<div id="body-wrapper">
	<div id="main-content">
		<div class="clear"></div>
		<div class="content-box">
			<div class="content-box-header">
				<h3>问题管理</h3>
				<ul class="content-box-tabs">
				</ul>
				<div class="clear"></div>
			</div>
			<div class="content-box-content">
				<div class="tab-content default-tab" id="tab1">
					<form id="_search_form" action="admin/question/list/" method="post">
						<p>
							<label>
							根据关键词搜索：&nbsp;&nbsp;
							<input class="text-input small-input" type="text" id="keyword" name="keyword" value="<?php echo $this->keyword; ?>"/>&nbsp;&nbsp;
							<input class="button" type="submit" value="搜  索" />
							<?php if($this->keyword){ ?>
							&nbsp;&nbsp;&nbsp;&nbsp;
							<input class="button" type="submit" onClick="$('#keyword').val('');$('#_search_form').submit();" value="显示全部" />
							<?php } ?>
							</label>
						</p>
					</form>
					
					<form id="batchs_form" action="admin/question/batch/" method="post">
					<?php if(!$this->list){ ?>
					<div class="notification attention png_bg"> <a href="#" class="close"><img src="<?php echo G_STATIC_URL;?>/admin/images/icons/cross_grey_small.png" title="Close this notification" alt="close" /></a>
						<div>
						<?php if($this->keyword){ ?> 搜索不到与&nbsp;<?php echo $this->keyword; ?>&nbsp;相关的内容， 返回<a href="javascript:;" onClick="$('#keyword').val('');$('#_search_form').submit();">显示全部</a>
						<?php }else{ ?>
							没有内容
						<?php } ?>
						</div>
					</div>
					<?php }else{ ?>
					<table>
						<thead>
							<tr>
								<!--th><input class="check-all" type="checkbox" /></th-->
								<th style="width:20px;"><input type="checkbox" class="check-all"></th>
								<th style="width:380px;">问题标题</th>
								<th>发布者</th>
								<th>发布时间</th>
								<th>浏览</th>
								<th>回复</th>
								<th>操作</th>
							</tr>
						</thead>
						<tfoot>
							<tr>
								<td colspan="7">
								
								<div class="bulk-actions align-left">
										<select name="batch_action">
											<option value="">选择操作</option>
											<option value="delete">批量删除</option>
										</select>
										<a class="button" onClick="ajax_post($('#batchs_form'), _ajax_post_alert_processer); return false;" href="javascript:;">批量执行操作</a>
								</div>
									
									<div class="pagination">
										<?php echo $this->pagination; ?>
									</div>
									
									<div class="clear"></div>
									
									</td>
							</tr>
						</tfoot>
						<tbody>
        <?php foreach ($this->list AS $key => $val) { ?>
							<tr>
								<td><input type="checkbox" name="question_ids[]" value="<?php echo $val['question_id']; ?>"></td>
								<td><a href="question/<?php echo $val['question_id']; ?>" target="_blank" title="查看问题"><?php echo $val['question_content']; ?></a></td>
								<td><a href="people/<?php echo $val['published_user_name']; ?>" target="_blank"><?php echo $val['published_user_name']; ?></a></td>
								<td><?php echo date("Y-m-d H:i:s", $val['add_time']); ?></td>
								<td><?php echo $val['view_count']; ?></td>
								<td><?php if($val['answer_count']){ ?><a href="admin/answer/list/question_id-<?php echo $val['question_id']; ?>" title="查看回复"><?php echo $val['answer_count']; ?>个回复</a><?php }else{ ?>没有回复<?php } ?></td>
								<td><!-- Icons -->
									<a href="publish/question_id-<?php echo $val['question_id']; ?>#question" title="修改" target=_blank><img src="<?php echo G_STATIC_URL;?>/admin/images/icons/pencil.png" alt="修改" /></a>
								</td>
							</tr>
        <?php } ?>
						</tbody>
					</table>
					<?php } ?>
					</form>
				</div>
		</div>
		
		<div class="clear"></div>
		<div id="notf_tip" style="display:none;" class="notification png_bg"> <a href="javascript:;" class="close"><img src="<?php echo G_STATIC_URL;?>/admin/images/icons/cross_grey_small.png" alt="关闭" /></a>
			<div id="notf_cont"></div>
		</div>
		
	</div>
</div>

<?php TPL::output('admin/admin_footer.tpl.htm'); ?>